home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / slsw.zip / SUPER.FUN < prev    next >
Text File  |  1990-06-29  |  94KB  |  2,145 lines

  1.                     
  2.                     
  3.              Expanded Function Listing
  4.      --------------------------------------------
  5.   -------------------------------------------------
  6.   Function            ABORT()
  7.   Action              Pops up dialog box asking Abort ? Yes/No
  8.   Returns             expL True for Yes False for No
  9.   Category            Popup
  10.   Syntax              ABORT([expC],[expN1],[expN2],[expN3],[expN4])
  11.   Description         Pop up a dialog box asking Abort  Don't Abort
  12.                       Box color is C_POPCOL or optionally [expC]
  13.                       Box dimensions are: 9,29,13,51 or optionally
  14.                       [expN1],[expN2],[expN3],[expN4].
  15.   Examples            if ABORT()
  16.                          exit
  17.                       endif
  18.   Notes               First tests for last key = 27, if so, does dialog box.
  19.                       Returns .t. if Abort  , .f. if Don't Abort or .f. if
  20.                       last key not 27
  21.   Warnings            Uses MENU TO so may blow get stack if called in
  22.                       the middle of a READ. Cursor is left on.
  23.  
  24.   Found in : S_ABORT.PRG
  25.   
  26.   -------------------------------------------------
  27.   Function            ADDSPACE()
  28.   Action              Pads string with spaces
  29.   Returns             <expC> String padded with spaces.
  30.   Category            String
  31.   Syntax              ADDSPACE(<expC>,<expN>)
  32.   Description         Pads right side of <expC> with <expN> spaces.
  33.                       Truncates string if <expN> is shorter than
  34.                       original string length.
  35.   Examples            ADDSPACE("GARRY",10)
  36.                       results in "GARRY     "
  37.  
  38.   Found in : S_ADDSP.PRG
  39.   
  40.   -------------------------------------------------
  41.   Function            ALENGTH()
  42.   Action              Determines initialized length of an array
  43.   Returns             <expN> length of initialized array
  44.   Category            Array
  45.   Syntax              ALENGTH(<array>)
  46.   Description         Determines # of contiguous declared elements
  47.                       in <array>
  48.   Examples            declare friends[10]
  49.                       friends[1] = "WYN"
  50.                       friends[2] = "DAVE"
  51.                       friends[3] = "JUDY"
  52.                       friend_kount = ALENGTH(m->friends)
  53.  
  54.   Found in : S_ALENG.PRG
  55.   
  56.   -------------------------------------------------
  57.   Function            BLDARR()
  58.   Action              Builds an array from a delimited string
  59.   Returns
  60.   Category            Array
  61.   Syntax              BLDARR(<array>|<expC>,<expN>,<expC>)
  62.   Description         Fills in the elements of an existing array
  63.                       <expC>|<array> with <expN> character values
  64.                       extracted from a delimited string <expC> of
  65.                       the form "Garry:Wyn:Ralph:Ed". The colon [:]
  66.                       is the delimiter.
  67.   Options             The first parameter may be either an array
  68.                       OR the name of an array (to retain
  69.                       compatibility with an older version when I knew
  70.                       even less about parameters than I do now)
  71.   Examples            declare lunch[3]
  72.                       BLDARR(m->lunch,3,"Pizza:Chicken:Burgers")
  73.   Notes               Array must be declared prior to calling
  74.   
  75.  
  76.   Found in : S_BLDAR.PRG
  77.   
  78.   -------------------------------------------------
  79.   Function            BLDDBF()
  80.   Action              Create a DBF from a delimited string
  81.   Returns             <expL> based on success.
  82.   Category            DBF
  83.   Syntax              BLDDBF(<expC1>,<expC2>|<array>)
  84.   Description         Creates DBF file named <expC1> from delimited
  85.                       strings in <expC2>|<array>.
  86.   
  87.                       Parameter 2 is either:
  88.                       1. a Delimited string in the
  89.                         form  "name,type,[size],[decimals]:name,type..."
  90.                         Fields delimited by colon, field elements
  91.                         delimited by commas.
  92.                                   -- or --
  93.                       2. an array of delimited strings in
  94.                       the form "name,type,[size],[decimals]". One field
  95.                       per array element, field elements delimited
  96.                       by commas.
  97.   Examples            1. Passing long delimited string
  98.                          BLDDBF('CUSTOMER','LNAME,C,15:FNAME,C,10:
  99.                          AGE,N,2:PROSPECT,L:')
  100.   
  101.                       2. Passing array of short delimited strings
  102.                          declare newdbf[4]
  103.                          newdbf[1]="LNAME,C,15"
  104.                          newdbf[2]="FNAME,C,10"
  105.                          newdbf[3]="AGE,N,2"
  106.                          newdbf[4]="PROSPECT,L"
  107.   
  108.                          BLDDBF('CUSTOMER',M->newdbf)
  109.   
  110.   Notes               I'd stick to small DBFs on this one 5 - 10 fields.
  111.                       if using a long delimited string.
  112.   
  113.                       BLDDBF() expects an unused area to work in, and
  114.                       will return .f. if it detects a DBF open in
  115.                       the current area. An overwrite will not be
  116.                       allowed.
  117.  
  118.   Found in : S_BLDBF.PRG
  119.   
  120.   -------------------------------------------------
  121.   Function            BLDNDX()
  122.   Action              Interactively create a new index
  123.   Returns             <expC> New index name less extension
  124.   Category            Metafunction
  125.   Syntax              BLDNDX([array])
  126.   Description         Allows point and shoot building of a new
  127.                       index.
  128.   Options             <array> - an array of legal field
  129.                       names. If not passed, all fields in current
  130.                       DBF will be used.
  131.   
  132.   Examples            BLDNDX()
  133.                        -- or --
  134.                       declare ndxflds[4]
  135.                       ndxflds[1]="LASTNAME"
  136.                       ndxflds[2]="FIRSTNAME"
  137.                       ndxflds[3]="CITY"
  138.                       ndxflds[4]="ZIP"
  139.                       BLDNDX(m->ndxflds)
  140.   
  141.   Notes               All fields are converted to type Character.
  142.                       The function NBR2STR() is used to create a usable
  143.                       character expression from a numeric field by first
  144.                       adding 1,000,000 to the number.
  145.   
  146.   Warnings            Indexes created with this function will require
  147.                       the functions DTOS() and NBR2STR() be loaded prior
  148.                       to use.
  149.                       Key -9 is unset on exit (F10)
  150.                       Cursor is left ON
  151.  
  152.   Found in : S_BLDNDX.PRG
  153.   
  154.   -------------------------------------------------
  155.   Function            CLABEL()
  156.   Action              Menu driven module for label management
  157.   Returns
  158.   Category            Metafunction
  159.   Syntax              CLABEL()
  160.   Description         This function requires no parameters and is
  161.                       entirely menu driven. Clipper compatible LBL
  162.                       files are created and maintained. Labels may
  163.                       be printed by Query matches, by Tagging, or
  164.                       all records. All Clipper formats are supported.
  165.   Examples            use CUSTOMER
  166.                       CLABEL()
  167.   Notes               Requires datafile to be open.
  168.                       Creates and modifies Clipper compatible LBL files.
  169.                       NEW (version 1.50) - does not call LABEL FORM - this
  170.                       pulls in 18K extra - instead, uses its own label
  171.                       printing routine. Label printing routine compresses
  172.                       blank lines (i.e. a 2nd address), as well as
  173.                       removing all but single space in a line (i.e. for
  174.                       FIRSTNAME+LASTNAME)
  175.   
  176.   Warnings            Key -9 is unset on exit (F10)
  177.                       Key -1 is unset on exit (F2)
  178.                       Key -2 is unset on exit (F3)
  179.  
  180.   Found in : S_CLAB.PRG
  181.   
  182.   -------------------------------------------------
  183.   Function            CLS()
  184.   Action              Clear the screen with optional color,character
  185.   Returns
  186.   Category            Screen
  187.   Syntax              CLS([expN],[expC])
  188.   Description         Clear the screen.
  189.   Options             Optional color [expN] and character [expC].
  190.   Examples            CLS()     && clears screen with current color
  191.                       CLS(48)   && clears screen with black on cyan
  192.                       CLS(8,chr(177))  && clears screen grey on black
  193.                                        && with character 177 (▒)
  194.  
  195.   Found in : S_CLS.PRG
  196.   
  197.   -------------------------------------------------
  198.   Function            CTRLW()
  199.   Action              Sends chr(23) (Control-W) to the keyboard
  200.   Returns
  201.   Category            Keyboard
  202.   Syntax              SET KEY XXX to CTRLW
  203.   Description         Allows remapping a key to Ctrl-W - a common
  204.                       Clipper EXIT key. CTRL-W is not a really
  205.                       intuitive key, but is often required by
  206.                       Clipper. I'll often set F10 to act as
  207.                       Ctrl-W.
  208.   Examples            SET KEY 27 to CTRLW  && remaps ESCAPE to CTRL-W
  209.   
  210.   Notes               Declare as EXTERNAL i.e.
  211.                       EXTERNAL CTRLW
  212.   
  213.  
  214.   Found in : S_CTRLW.PRG
  215.   
  216.   -------------------------------------------------
  217.   Function            DELARRAY()
  218.   Action              Deletes all elements of an array
  219.   Returns
  220.   Category            Array
  221.   Syntax              DELARRAY(<array>)
  222.   Description         Deletes all elements of an array. Basically
  223.                       un-initializes the array.
  224.   Examples            * Say you wish to re-use an array, passing
  225.                       * it to ACHOICE() each time around, and it
  226.                       * may have different lengths each time. What
  227.                       * you want to do is get rid of any extra
  228.                       * elements before re-filling the array.
  229.                       * e.g.
  230.                       declare reuse[200]
  231.                       *
  232.                       DO WHILE .t.
  233.                         * (code to pick and open dbf)
  234.                         * (code to pick and open dbf)
  235.                         afields(m->reuse)
  236.                         fieldpick = achoice(10,10,20,40,m->reuse)
  237.                         * (do something with field selected)
  238.                         * (do something with field selected)
  239.                         DELARRAY(m->reuse)
  240.                       ENDDO
  241.  
  242.   Found in : S_DELAR.PRG
  243.   
  244.   -------------------------------------------------
  245.   Function            DELREC()
  246.   Action              Dialog box to delete/undelete current record
  247.   Returns             <expN> If deleted 1, if undeleted-1, if no action 0
  248.   Category            Popup
  249.   Syntax              DELREC()
  250.   Description         Asks for delete/undelete record with menu prompt
  251.                       and then deletes/undeletes or not
  252.                       If current record is not deleted, prompt will be
  253.                       DELETE  NOACTION
  254.                       If current record is deleted, prompt will be
  255.                       UNDELETE  NOACTION
  256.   Examples            IF m->choice = 6
  257.                             delcount = DELREC()
  258.                       ENDIF
  259.   Warnings            Cursor is left ON
  260.  
  261.   Found in : S_DELET.PRG
  262.   
  263.   -------------------------------------------------
  264.   Function            DOITALL()
  265.   Action              Generic menu driven data entry module
  266.   Returns
  267.   Category            Metafunction
  268.   Syntax              DOITALL([array1],[array2],[array3],[array4])
  269.   Description         Presents a menu driven data entry screen for
  270.                       the current dbf, with options for Next Previous
  271.                       Search Lookup Edit Add Delete and Other.
  272.                       By default uses all fields in the current
  273.                       DBF, but may be passed two arrays
  274.                       to restrict field access:
  275.   
  276.   Options             Optional Parameters are:
  277.                       1. Array of options for 'Other' menu
  278.                       2. Procs to perform to match these options
  279.                       3. Array of field names
  280.                       4. Array of field descriptions
  281.   
  282.                       Both arrays 1 and 2 must be passed if one is passed.
  283.                       Both arrays 3 and 4 must be passed if one is passed.
  284.                       Last menu item must be QUIT or EXIT. An exit
  285.                       from the OTHER menu is performed if the last
  286.                       item is selected.
  287.   Examples
  288.                       use Customer index Customer
  289.                       Doitall()
  290.   
  291.                       * or....
  292.   
  293.                       use Customer index Customer
  294.                       private a1[3],a2[3]
  295.                       a1[1]= "Query"
  296.                       a1[2]= "Print"
  297.                       a1[3]= "Quit"
  298.   
  299.                       EXTERNAL QUERY,LISTER
  300.                       a2[1]= "QUERY"       && call QUERY()
  301.                       a2[2]= "LISTER"      && call LISTER()
  302.                       a2[3]= " "           && NOTE: no parentheses.
  303.   
  304.                       DOITALL(m->a1,m->a2)
  305.   
  306.                       * or with optional field arrays.....
  307.   
  308.                       declare useflds[3],flddesc[3]
  309.                       useflds[1]="LAST"
  310.                       useflds[2]="FIRST"
  311.                       useflds[3]="MI"
  312.                       flddesc[1]="Last Name"
  313.                       flddesc[2]="First Name"
  314.                       flddesc[3]="Middle Init"
  315.   
  316.                       DOITALL(m->a1,m->a2,m->useflds,m->flddesc)
  317.   
  318.   Notes
  319.                       I would use this, normally, if my program was
  320.                       not going to know ahead of time what a dbf might
  321.                       look like - or even what dbf will be used.
  322.                       Obviously if you know what your dbf is going to
  323.                       look like you can come up with a slicker, customized
  324.                       interface.
  325.   
  326.                       DOITALL() takes over the PGUP PGDN keys during
  327.                       its menu phase by SETing KEYs to them. So be
  328.                       careful of any popup procs you may be using - PGUP
  329.                       and PGDN will not be available.
  330.   
  331.                       If passing arrays for the OTHER menu, be sure the
  332.                       procs to be called are known to the compiler, either
  333.                       by being called elsewhere in the program, or by
  334.                       using EXTERNAL. (see above)
  335.   
  336.   Warnings            Key -9 is unset on exit (F10), Cusor is left ON.
  337.  
  338.   Found in : S_DOALL.PRG
  339.   
  340.   -------------------------------------------------
  341.   Function            DRIVE()
  342.   Action              Gets currently selected drive letter
  343.   Returns             <expC> drive letter ABCDEF etc
  344.   Category            File
  345.   Syntax              DRIVE()
  346.   Description         Returns current drive (ABCDEF etc) as a letter
  347.                       without the colon [:].
  348.   Options
  349.   Examples            @24,0 say "Current Drive is "+DRIVE()+":"
  350.   
  351.  
  352.   Found in : S_DRIVE.PRG
  353.   
  354.   -------------------------------------------------
  355.   Function            DUPLOOK()
  356.   Action              Locates possible duplicates based on user criteria
  357.   Returns
  358.   Category            Metafunction
  359.   Syntax              DUPLOOK([expC])
  360.   Description         Searches current dbf for exact duplicates of
  361.                       field(s) selected by user. User picks a field
  362.                       or fields, DUPLOOK() creates an index and prepares
  363.                       a possible duplicates report.
  364.   
  365.   Options             <expC> Character expression as additional info for
  366.                       each report line printed. (report normally only
  367.                       refers to record# and the fields selected )
  368.   
  369.   Examples            DUPLOOK("Lastname+'  '+Firstname")
  370.                       * whatever fields the user picks to check duplicates
  371.                       * on, the LASTNAME and FIRSTNAME fields are also
  372.                       * printed on the report.
  373.   
  374.                       Sample Output:
  375.   
  376.                       Record #   FNAME
  377.                           1      GARRY
  378.                           2      GARRY
  379.   
  380.   Warnings            THIS FUNCTION CLOSES ANY OPEN INDEXES.
  381.                       YOU WILL NEED TO RE-OPEN INDEXES ON EXIT.
  382.   
  383.   Warnings            Key -9 is unset on exit (F10), cursor is left ON
  384.  
  385.   Found in : S_DUP.PRG
  386.   
  387.   -------------------------------------------------
  388.   Function            EDITDB()
  389.   Action              Customized DBEDIT() with UDF
  390.   Returns
  391.   Category            Metafunction
  392.   Syntax              EDITDB([expL],[expN],[array],[array])
  393.   Description         Customized DBEDIT() interface allowing searching,
  394.                       goto, vertical view and (if <expL> is True) add
  395.                       edit delete.
  396.                       Also allows limiting of fields viewed.
  397.   Options             [expL] allows add-edit-delete or not. Number
  398.                       of fields is contained in [expN]. The two arrays
  399.                       are of field names and field descriptions. Default
  400.                       is all fields, field names as descriptions.
  401.   Examples
  402.                       USE CUSTOMER
  403.                       private flds[3],fdes[3]
  404.                       flds[1] = "fname"
  405.                       flds[2] = "lname"
  406.                       flds[3] = "mi"
  407.                       fdes[1] = "First Name"
  408.                       fdes[2] = "Last Name"
  409.                       fdes[3] = "Middle Initial"
  410.                       editdb(.t.,3,flds,fdes)
  411.                       ...
  412.                       or
  413.                       ...
  414.                       USE CUSTOMER
  415.                       editdb()
  416.                       ...
  417.   Notes               Allows record deletion, but does not pack.
  418.                       Does not 'SET DELETED' one way or the other.
  419.   
  420.   Warnings            Key -9 is unset on exit (F10),cursor is left ON
  421.  
  422.   Found in : S_EDIT.PRG
  423.   
  424.   -------------------------------------------------
  425.   Function            EDITMEMO()
  426.   Action              Performs a windowed memoedit() on a memo field
  427.   Returns
  428.   Category            Popup
  429.   Syntax              EDITMEMO([expC],[expN1],[expN2],[expN3],[expN4])
  430.   Description         Pops up a box allowing editing of a memo field.
  431.                       Escape exits, F10 saves.
  432.   Options             Edits field named MEMO by default, otherwise
  433.                       fieldname passed as [expC]. Uses coordinates
  434.                       2,10,20,69 unless passed coordinates as
  435.                       [expN1..expn4] (top,left,bottom,right)
  436.   Examples            editmemo()
  437.                       editmemo("NOTES")
  438.                       editmemo("NOTES",2,2,22,78)
  439.   
  440.   Notes               Sets key -9 to CTRLW  (F10)
  441.   
  442.   Warnings            Key -9 is unset on exit (F10),cursor is left ON
  443.  
  444.   Found in : S_EDITM.PRG
  445.   
  446.   -------------------------------------------------
  447.   Function            ED_G_PIC()
  448.   Action              Returns appropriate picture for a get
  449.   Returns             <expC> picture clause
  450.   Category            Editing
  451.   Syntax              ED_G_PIC(<expC>)
  452.   Description         Returns a picture clause appropriate for
  453.                       editing field where <expC> is the name of the
  454.                       field.
  455.   Options
  456.   Examples            @10,10 GET AMOUNT PICT ED_G_PIC("AMOUNT")
  457.                       * would return a picture of "9999.99" depending
  458.                       * on length and decimals
  459.   
  460.   Examples found in   S_EDIT.PRG S_GLOBR.PRG S_QUERY.PRG S_LOOKF.PRG
  461.                       S_GENED.PRG
  462.   
  463.  
  464.   Found in : S_EDPICT.PRG
  465.   
  466.   -------------------------------------------------
  467.   Function            ENHANCED()
  468.   Action              Returns color integer for ENHANCED setting
  469.   Returns             <expN> color integer for ENHANCED setting
  470.   Category            Screen
  471.   Syntax              enh = ENHANCED()
  472.   Description         Gets the 2nd part of the color string and
  473.                       converts it to color
  474.   Options
  475.   Examples            enh = ENHANCED()
  476.                       ATT(10,10,10,20,m->enh)
  477.  
  478.   Found in : S_ENHAN.PRG
  479.   
  480.   -------------------------------------------------
  481.   Function            FORMDATE()
  482.   Action              Returns formatted date (i.e. September 10, 1989)
  483.   Returns             Date as words
  484.   Category            String
  485.   Syntax              FORMDATE(<expD>)
  486.   Description         Returns a string of words when passed a date.
  487.   Options
  488.   Examples            FORMDATE(DTOC("09/10/89"))
  489.                       will return "September 10, 1989"
  490.   
  491.   Notes               I use this to imbed date in form letters.
  492.   
  493.  
  494.   Found in : S_FDATE.PRG
  495.   
  496.   -------------------------------------------------
  497.   Function            FASTFORM()
  498.   Action              Prints a selected formletter for current record
  499.   Returns
  500.   Category            Metafunction
  501.   Syntax              FASTFORM()
  502.   Description         Presents a picklist of formletters to print
  503.                       against contents of current record.
  504.   Examples            If m->choice = 4   && form letter
  505.                           FASTFORM()
  506.                       endif
  507.   Notes               Utilizes a form created by FORMLETR() and plugs
  508.                       in values from the current record.
  509.                       Interface is a picklist of forms available.
  510.                       Depends on the current DBF to match the field
  511.                       values in the form.
  512.   
  513.  
  514.   Found in : S_FFORM.PRG
  515.   
  516.   -------------------------------------------------
  517.   Function            FGETLEN()
  518.   Action              Get length of a field in current DBF
  519.   Returns
  520.   Category            DBF
  521.   Syntax              FGETLEN(<expC>)
  522.   Description         Pass a field name in the currently open
  523.                       DBF to get the length of it.
  524.   
  525.   Examples            FGETLEN("FNAME")
  526.   
  527.  
  528.   Found in : S_FGETLE.PRG
  529.   
  530.   -------------------------------------------------
  531.   Function            FILEREAD()
  532.   Action              Lists a text file of unlimited size
  533.   Returns
  534.   Category            Metafunction
  535.   Syntax              FILEREAD([expN1],[expN2],[expN3],[expN4],[expC])
  536.   Description         Lists a text file [expC] of unlimited size in a user
  537.                       definable window. [expN1..expN4]  (top,left bottom,
  538.                       right) Allows up down right left scrolling. I use this
  539.                       for reports or output sent to a disk file.
  540.   Options             If [expN1..expN4] are not passed, a default of
  541.                       window of dimensions 2,2,22,78 is used. If no
  542.                       filename [expC] is passed, a popup picklist is
  543.                       used to get a file name from the current
  544.                       directory.
  545.   Examples
  546.                       REPORT FORM summary TO summary.txt
  547.                       FILEREAD(2,2,22,78,"SUMMARY.TXT")
  548.   
  549.   Notes               Unlimited file size. Won't bomb like memoedit.
  550.                       However, not nearly as fast as memoedit and
  551.                       no editing capabilities.
  552.   
  553.                       Fileread uses a 98% Clipper code routine to
  554.                       list text files.
  555.   Warning             Cursor is left ON
  556.  
  557.   Found in : S_FILER.PRG
  558.   
  559.   -------------------------------------------------
  560.   Function            FORMLETR()
  561.   Action              Interactive formletter and mailmerge utility
  562.   Returns
  563.   Category            Metafunction
  564.   Syntax              FORMLETTER([array],[array])
  565.   Description         Provides a menu driven interface to the
  566.                       creation, modification and merging of form
  567.                       letters with DBFs.
  568.   Options             Two arrays may be passed - array 1 is an array
  569.                       of allowable field names. Array two is an array
  570.                       of field descriptions. All fields are used as
  571.                       a default, with field names being the default
  572.                       field descriptions.
  573.   Examples
  574.                       USE CUSTOMER
  575.                       private flds[3],fdes[3]
  576.                       flds[1] = "fname"
  577.                       flds[2] = "lname"
  578.                       flds[3] = "mi"
  579.                       fdes[1] = "First Name"
  580.                       fdes[2] = "Last Name"
  581.                       fdes[3] = "Middle Initial"
  582.                       formletr(flds,fdes)
  583.                       ...
  584.                       ....or....
  585.                       USE CUSTOMER
  586.                       formletr()
  587.                       ...
  588.   
  589.   Warnings            Key -9 is unset on exit (F10)
  590.                       Key -1 is unset on exit (F2)
  591.                       Key 23 is unset on exit (F1)
  592.                       Cursor is left ON
  593.  
  594.   Found in : S_FORML.PRG
  595.   
  596.   -------------------------------------------------
  597.   Function            FULLDIR()
  598.   Action              Interactively navigate directories
  599.   Returns             <expL> True if directory change occurred
  600.   Category            Metafunction
  601.   Syntax              FULLDIR()
  602.   Description         Interactively navigates directories on the
  603.                       current drive.
  604.                       Allows pop-up list of files in a directory.
  605.                       Allows reading of a file ( with FILEREAD() )
  606.                       in a directory.
  607.                       If file is DBF, does a DBEDIT browse (watch
  608.                       your memory..)
  609.   Examples
  610.                       if FULLDIR()
  611.                           ?"New directory is:"
  612.                           ?Curdir()
  613.                       endif
  614.   
  615.  
  616.   Found in : S_FULLD.PRG
  617.   
  618.   -------------------------------------------------
  619.   Function            GENED()
  620.   Action              Generic dbf editing screen
  621.   Returns
  622.   Category            Metafunction
  623.   Syntax              GENED([expL],[expN1],[expN2],[array1],[array2])
  624.   Description         Edit ( [expL]=.f.) current record or
  625.                       Add  ( [expL]=.t.) new record.
  626.   Options             Window top [expN1] and bottom [expN2] default to
  627.                       centered.
  628.   
  629.                       Use optional [array1] (field names) and
  630.                       [array2] (field descriptions), or use all fields
  631.                       in dbf.
  632.   
  633.   Examples            use Customer index Customer
  634.                       Gened(.f.,2,20)             && edit
  635.                       ...
  636.                       or
  637.                       use Customer index Customer
  638.                       Gened(.t.,3,15)             && add
  639.                       ...
  640.                       or
  641.                       use Customer index Customer
  642.                       Gened()                     && edit
  643.                       ...
  644.   
  645.   Notes               Sets keys -9 (F10) and -1 (F2)
  646.                       Allows memo editing (multiple memo fields)
  647.   
  648.   Warnings            Key -9 is unset on exit (F10)
  649.                       Key -2 is unset on exit (F3)
  650.                       Cursor is left ON
  651.  
  652.   Found in : S_GENED.PRG
  653.   
  654.   -------------------------------------------------
  655.   Function            GENVAL()
  656.   Action              Generic VALID clause validation with message
  657.   Returns             <expL> logical result of passed condition
  658.   Category            Editing
  659.   Syntax              GENVAL(<expC1>,<expC2>)
  660.   Description         Evaluates macro expansion of <expC1> as a logical
  661.                       value. If result is False, displays message <expC2>
  662.                       and waits for a keypress.
  663.   Examples
  664.                       if genval("fcount() < 60","Too many fields")
  665.                          COPY TO TEMP
  666.                       endif
  667.   
  668.                       * ...or as a VALID CLAUSE
  669.   
  670.                       @10,10 get m->lname VALID GENVAL("!empty(m->lname)",;
  671.                         "Need a last name,please")
  672.   
  673.  
  674.   Found in : S_GENVA.PRG
  675.   
  676.   -------------------------------------------------
  677.   Function            GETAKEY()
  678.   Action              Gets intent of last keystroke
  679.   Returns             <expC> as key direction (FWD,BWD,ESC,CTW,UNK)
  680.   Category            Editing
  681.   Syntax              GETAKEY(lastkey())
  682.   Description         Gives key direction of last key, for evaluating
  683.                       what direction in a read the user is heading.
  684.   Examples            If GETAKEY(LASTKEY())="FWD"
  685.                           active_field = active_field+1
  686.                       elseif GETAKEY(LASTKEY())="BWD"
  687.                           active_field = active_field+1
  688.                       endif
  689.   
  690.   
  691.  
  692.   Found in : S_GETKEY.PRG
  693.   
  694.   -------------------------------------------------
  695.   Function            GLOBREP()
  696.   Action              Performs global selective replace of a field
  697.   Returns
  698.   Category            Metafunction
  699.   Syntax              GLOBREP([array])
  700.   Description         Allows user to point to a field, optionally field
  701.                       given in [array], and then enter a replacement
  702.                       value for it. Replacement can be executed for
  703.                       all records, query matches, or tagged records.
  704.   
  705.   Options             Optional field array [array] with default being
  706.                       all fields in dbf.
  707.   
  708.   Examples            If choice = 9  && Global replace
  709.                           GLOBREP()
  710.                       endif
  711.   Warnings            These changes are, of course, permanent.
  712.   
  713.   
  714.  
  715.   Found in : S_GLOBR.PRG
  716.   
  717.   -------------------------------------------------
  718.   Function            HELP()
  719.   Action              Provides context sensitive popup help
  720.   Returns
  721.   Category            Help
  722.   Syntax              SET KEY xxx TO HELP
  723.   Description         By setting a key xxx to this function, the
  724.                       current PROC and VARIABLE are passed to it
  725.                       when the key is pressed during the program.
  726.                       By comparing the PROC and VARIABLE parameters
  727.                       against entries in the HELP.DBF, HELP() can
  728.                       then provide the appropriate help screen for
  729.                       the user. If no matching record is found, HELP()
  730.                       displays a 'No Help Found' message to the user.
  731.   
  732.                       HELP() works in conjunction with HELPMOD() which
  733.                       is used to create help screen records for the
  734.                       HELP.DBF. HELPMOD() allows online creation and
  735.                       modification of the size, location and contents
  736.                       of the help screen for the current PROC,VARIABLE
  737.                       combination.
  738.   
  739.                       It is important to issue the following statement
  740.                       in your code: EXTERNAL HELP
  741.                       This is due to Clipper not recognizing and linking
  742.                       in procs that are only referenced as SET KEY's.
  743.   Examples            EXTERNAL HELP
  744.                       SET KEY 28 to HELP
  745.   Notes               This approach has two major limitations. When a SET
  746.                       KEY function is called while the program is in
  747.                       ACHOICE(), only the ACHOICE is passed as a PROC, and
  748.                       no variable is passed. Thus, only one help screen
  749.                       for the proc ACHOICE is definable for an entire
  750.                       system.
  751.   
  752.                       The 2nd is a difficulty with MENU TO. The PROC and
  753.                       VARIABLE allow 1 help screen per MENU TO, as the
  754.                       PROC,VARIABLE stays the same no matter which option
  755.                       is hilited.
  756.   
  757.                       Both FUNCKY and GET-IT (libraries) have functions
  758.                       which would help get around these limitations.
  759.   
  760.                       For READS, however, this HELP works pretty well.
  761.   
  762.   Warnings            The 'HELP' key is still active while in this
  763.                       proc. If you have a means of turning the
  764.                       help key off and on, do so here.
  765.   
  766.  
  767.   Found in : S_HELP.PRG
  768.   
  769.   -------------------------------------------------
  770.   Function            HELPMOD()
  771.   Action              Interactively build and modify help screens
  772.   Returns
  773.   Category            Development
  774.   Syntax              SET KEY xxx TO HELPMOD
  775.   Description         HELPMOD() creates and modifies help screens for
  776.                       HELP() which are stored in HELP.DBF.
  777.                       HELPMOD() allows online creation and
  778.                       modification of the size, location and contents
  779.                       of the help screen for the current PROC,VARIABLE
  780.                       combination, and stores the results in HELP.DBF.
  781.   
  782.                       HELPMOD() is intended to be used online, during
  783.                       program execution, by the developer/programmer.
  784.                       It can be removed after development.
  785.   
  786.                       By setting a key xxx to this function, the
  787.                       current PROC and VARIABLE are passed to it
  788.                       when the key is pressed during the program.
  789.                       By comparing the PROC and VARIABLE parameters
  790.                       against entries in the HELP.DBF, HELPMOD() can
  791.                       then provide the appropriate help screen for
  792.                       modification, or, if no matching record is found,
  793.                       allow creation of a new help screen record.
  794.   
  795.                       It is important to issue the following statement
  796.                       in your code: EXTERNAL HELPMOD
  797.                       This is due to Clipper not recognizing and linking
  798.                       in procs that are only referenced as SET KEY's.
  799.   
  800.                       HELP.DBF is created if not present.
  801.   
  802.   Examples            EXTERNAL HELPMOD
  803.                       SET KEY -30 TO HELPMOD   && alt-F1
  804.   Notes               This approach has two major limitations. When a SET
  805.                       KEY function is called while the program is in
  806.                       ACHOICE(), only the ACHOICE is passed as a PROC, and
  807.                       no variable is passed. Thus, only one help screen
  808.                       for the proc ACHOICE is definable for an entire
  809.                       system.
  810.   
  811.                       The 2nd is a difficulty with MENU TO. The PROC and
  812.                       VARIABLE allow 1 help screen per MENU TO, as the
  813.                       PROC,VARIABLE stays the same no matter which option
  814.                       is hilited.
  815.   
  816.                       Both FUNCKY and GET-IT (libraries) have functions
  817.                       which would help get around these limitations.
  818.   
  819.                       For READS, however, this HELP works pretty well.
  820.   
  821.   Warnings            HELP.DBF is a common enough name. If problems
  822.                       arise, make sure there is not an old HELP.DBF
  823.                       with a different file sctructure in the directory.
  824.   
  825.   Warnings            Key -9 is unset on exit (F10),Cursor is left ON
  826.  
  827.   Found in : S_HELPM.PRG
  828.   
  829.   -------------------------------------------------
  830.   Function            INITSUP()
  831.   Action              Initialized global variables and conditions
  832.   Returns
  833.   Category            Environment
  834.   Syntax              INITSUP()
  835.   Description         INITSUP() simply initializes the global colors
  836.                       expected by Metafunction functions if they are
  837.                       not already present, and sets the TYPEAHEAD to
  838.                       100 to accomodate SCROLLER and SMALLS.
  839.   Examples            * beginning of top level program
  840.                       INITSUP()
  841.   Examples found in   Almost all Metafunction functions.
  842.   
  843.   Notes               Its always a good idea to call this at your
  844.                       top level program.
  845.   
  846.  
  847.   Found in : S_INIT.PRG
  848.   
  849.   -------------------------------------------------
  850.   Function            INITCOL()
  851.   Action              Initializes global colors for the library
  852.   Returns
  853.   Category            Environment
  854.   Syntax              INITCOL()
  855.   Description         Sets up as PUBLIC the global color and screen
  856.                       variables used by the Metafunctions
  857.   Examples            if type("C_NORMCOL")<>"C"
  858.                          INITCOL()
  859.                       endif
  860.   Notes               No real need to call this, as it is called if
  861.                       needed by INITSUP()
  862.   
  863.  
  864.   Found in : S_INITC.PRG
  865.   
  866.   -------------------------------------------------
  867.   Function            ISLOADED()
  868.   Action              Determines  function is loaded or not
  869.   Returns             <expL> is ISLOADED(<expC>) loaded
  870.   Category            Other
  871.   Syntax              <expL> = ISLOADED(<expC>)
  872.   Description         This function will test for <expC> being loaded
  873.                       into memory. <expC> can be any function in the form
  874.                       "FUNCTION()" but must refer to a function NOT in
  875.                       CLIPPER.LIB.
  876.   Examples            if ISLOADED("QUERY()")
  877.                          @row()+1,3 prompt "Build Query"
  878.                       endif
  879.   
  880.  
  881.   Found in : S_ISLOAD.PRG
  882.   
  883.   -------------------------------------------------
  884.   Function            ISPART()
  885.   Action              Determines if a number is part of a set
  886.   Returns             <expL> if number is part of set
  887.   Category            Other
  888.   Syntax              ISPART(<expN1>,<expN2>,<expN3>,...<expN10>)
  889.   Description         Compares a number <expN1> to a set of numbers
  890.                       <expN2..expN10> to determine if it is equal to
  891.                       any of them. Returns True if it is, False otherwise.
  892.   Options             Up to 9 numbers to compare.
  893.   Examples            If ISPART(choice,5,6,7,12)
  894.                         MSG("Need a DBF open")
  895.                         loop
  896.                       endif
  897.   
  898.  
  899.   Found in : S_ISPART.PRG
  900.   
  901.   -------------------------------------------------
  902.   Function            KBD_ESCAPE()
  903.   Action              Keyboards character 27 (escape) when key pressed
  904.   Returns
  905.   Category            Keyboard
  906.   Syntax              SET KEY xxx TO KBD_ESCAPE
  907.   
  908.   Description         Allows setting an alternate key to the ESCAPE
  909.                       key. ESCAPE normally means 'get me outta here',
  910.                       but sometimes is the key you need to indicate
  911.                       the user is done selecting or some such. This
  912.                       function allows setting another key (e.g. F10)
  913.                       to act as the ESCAPE key.
  914.   
  915.   Examples found in   EXTERNAL KBD_ESCAPE
  916.                       SET KEY -9 TO KBD_ESCAPE
  917.   
  918.   Notes               Declare as EXTERNAL i.e.
  919.                       EXTERNAL KBD_ESCAPE
  920.   
  921.   Warnings            Be sure to issue a SET KEY xxx TO command to
  922.                       un-map this function when done
  923.   
  924.  
  925.   Found in : S_KBDESC.PRG
  926.   
  927.   -------------------------------------------------
  928.   Function            LISTER()
  929.   Action              Build, format and print lists to printer,screen,file
  930.   
  931.   Category            Metafunction
  932.   
  933.   Syntax              LISTER([array1],[array2],[array3],[array4])
  934.   
  935.   Description         A menu driven utility for creation, printing and
  936.                       storage of list definitions.
  937.   
  938.                       The user is asked to pick the fields to be
  939.                       included on the list. The selected fields, in the
  940.                       order in which they will be listed, are shown in
  941.                       the bottom information box.
  942.   
  943.                       The user may select which records are to be
  944.                       included in the list - all records, query matches
  945.                       or tagged records.
  946.   
  947.                       The user may select output as PRINTER, SCREEN or
  948.                       FILE, and choose the maximum line length to avoid
  949.                       printer wraparound.
  950.   
  951.                       The user may save list definitions to PLIST.DBF
  952.                       and later restore them.
  953.   
  954.   Options             Four arrays may be passed - fieldnames [array1],
  955.                       field descriptions [array2], field types [array3],
  956.                       and field lengths [array4]. All or none must be
  957.                       passed. Normally, field names are used as the
  958.                       column headings for the list, but if [array2] is
  959.                       passed, these descriptions are used in the column
  960.                       headings of their corresponding fields.
  961.   
  962.                       By default, all fields are used, field names are
  963.                       used for descriptions and AFIELDS() is used to
  964.                       get the types and lengths.
  965.   Examples
  966.                       USE CUSTOMER
  967.                       private flds[3],fdes[3],ftype[3],flen[3]
  968.                       afields(m->flds,m->ftype,m->flen)
  969.                       fdes[1] = "First Name"
  970.                       fdes[2] = "Last Name"
  971.                       fdes[3] = "Middle Initial"
  972.                       lister(flds,fdes,dtype,flen)
  973.                       ...
  974.                       or
  975.                       ...
  976.                       USE CUSTOMER
  977.                       lister()
  978.                       ...
  979.   Notes               This is a 2nd generation of PRNTLST(). I like it
  980.                       better in that it is easier to go into the code
  981.                       and follow what's going on with it. It makes more
  982.                       use of arrays, and less use of MACROS. Its also
  983.                       a better foundation to build more intelligent
  984.                       report capabilities on top of.
  985.   
  986.   Warnings            Key -9 is unset on exit (F10)
  987.   
  988.  
  989.   Found in : S_LIST.PRG
  990.   
  991.   -------------------------------------------------
  992.   Function            LOOKFLD()
  993.   Action              Interactive locate on any field
  994.   Returns
  995.   Category            Metafunction
  996.   Syntax              LOOKFLD([array1],[array2])
  997.   Description
  998.                       Lookfld() pops up a window of the fields, and then
  999.                       asks for a <range of> value(s) to search for.
  1000.                       If a LOCATE is successful, the next call to
  1001.                       lookfld() will optionally do a CONTINUE.
  1002.   Options
  1003.                       Arrays of FIELDS [array1] and FIELD DESCRIPTION
  1004.                       [array2] may be sent as params, and the selection is
  1005.                       then limited to the fields in these arrays
  1006.   Examples
  1007.                       if choice = 5 && search for date
  1008.                         LOOKFLD()
  1009.                       endif
  1010.                       ....or
  1011.                       * assumes fields[] and fdesc[] exist
  1012.                       if choice = 5 && search for date
  1013.                         LOOKFLD(m->fields,m->fdesc)
  1014.                       endif
  1015.   
  1016.   Notes               RECORD POINTER IS LEFT ON NEW RECORD IF FOUND
  1017.   
  1018.                       The variable lf_cont_  is made public. lf_cont_
  1019.                       determines if a CONTINUE is appropriate.
  1020.   
  1021.                       The variables lk_fld_ and lk_lookr are declared public
  1022.                       as they are a variable part of the LOOKUP command to be
  1023.                       given. Since we will exit this function but we want
  1024.                       these vars to survive for a CONTINUE, they are declared
  1025.                       public. If they were not declared public, a continue
  1026.                       would not be possible.
  1027.   
  1028.                       Best description: open a DBF and call LOOKFLD()
  1029.   
  1030.   Warnings            Cursor is left ON
  1031.  
  1032.   Found in : S_LOOKF.PRG
  1033.   
  1034.   -------------------------------------------------
  1035.   Function            LOOPER()
  1036.   Action              Emulate multiple reads with single reads
  1037.   Returns
  1038.   Category            Editing
  1039.   Syntax              LOOPER(<array>)
  1040.   Description         Allows a group of gets to be READ individually,
  1041.                       but appear to be a single READ.
  1042.   
  1043.                       This function allows complex functions to be called for
  1044.                       VALID which can use their own READs and not
  1045.                       interrupt a read stack. This can give the apparancy
  1046.                       of nested READs. Recursive calls to this function
  1047.                       can be done as well.
  1048.   
  1049.                       Each element of <array> is a delimited string of
  1050.                       row,col,get,picture,valid clause.
  1051.                       ( "row:col:getname:picture:valid"  )
  1052.   Examples            .
  1053.                       *- first declare any called functions external
  1054.                       EXTERNAL YOURFUNC
  1055.                       *- initialize an array
  1056.                       private sayg[3]
  1057.   
  1058.                       *  initialize the memvars to be read - IMPORTANT
  1059.                       PHONE = space(14)
  1060.                       CHARGE = 0
  1061.                       NAME= SPACE(20)
  1062.   
  1063.                       *       column-|
  1064.                       *        row   | get name  picture       valid
  1065.                       *          |   |   |       |              |
  1066.                       sayg[1]="10:10:M->phone:(999)999-9999:!empty(m->phone)"
  1067.                       sayg[2]="11:10:M->charge:@K 99.99"
  1068.                       sayg[3]="12:10:M->name:!:YOURFUNC()"
  1069.   
  1070.                       LOOPER(m->sayg)
  1071.   
  1072.   
  1073.  
  1074.   Found in : S_LOOP.PRG
  1075.   
  1076.   -------------------------------------------------
  1077.   Function            MAKEBOX()
  1078.   Action              Draws a shadow box on the screen, saves the screen
  1079.   Returns             <expC> string containing underlying screen & colors
  1080.   Category            Popup
  1081.   Syntax              MAKEBOX(<expN1>,<expN2>,<expN3>,<expN4>,[expC],[expN5])
  1082.   
  1083.   Description         Draws a box on the screen at coordinates <expN1..expN4>
  1084.                       (top,left,bottom,right). Returns a string containing
  1085.                       the underlying screen and previous color. Box will
  1086.                       explode or not based on the global variable C_XPLODE.
  1087.                       To bypass the global C_XPLODE setting, save C_XPLODE
  1088.                       to another variable, set C_XPLODE to the desired
  1089.                       setting, call MAKEBOX() and ensuing code. Then restore
  1090.                       C_XPLODE to its prior global status.
  1091.   
  1092.   Options             Default color is C_POPCOL and default shadow position
  1093.                       is the global variable C_SHADPOS. These may be passed
  1094.                       as options . Shadow position [expN5] has allowable
  1095.                       values of (1,3,7,9,0) to match the corner positions on
  1096.                       the numeric keypad. 0 is no shadow. [expC] is a valid
  1097.                       color string or variable.
  1098.   
  1099.   Examples            box = MAKEBOX(5,5,10,10)
  1100.                       * draws a box at 5,5,10,10. Color is C_POPCOL. Shadow
  1101.                       * position is based on C_SHADPOS.
  1102.   
  1103.                       box = MAKEBOX(5,5,10,10,C_POPCOL)
  1104.                       * draws a box at 5,5,10,10. Color is C_POPCOL. Shadow
  1105.                       * position is based on C_SHADPOS.
  1106.   
  1107.                       box = MAKEBOX(5,5,10,10,C_POPCOL,9)
  1108.                       * draws a box at 5,5,10,10. Color is C_POPCOL. Shadow
  1109.                       * position is 9 (upper right hand corner).
  1110.   
  1111.   Notes               UNBOX() removes the box and restores the
  1112.                       underlying screen and prior colors.
  1113.   
  1114.   Warnings            USE ONLY UNBOX() TO REMOVE SCREENS STORED WITH
  1115.                       MAKEBOX.
  1116.   
  1117.  
  1118.   Found in : S_MAKEB.PRG
  1119.   
  1120.   -------------------------------------------------
  1121.   Function            MCHOICE()
  1122.   Action              Creates a box for an Achoice call
  1123.   Returns             <expN> Achoice selection
  1124.   Category            Popup
  1125.   Syntax              MCHOICE(<expC1>|<array>,<expN1..expN4>,[expC2],[expL])
  1126.   Description         Provides a box for an achoice on array named <expC1>
  1127.                       or array <array>
  1128.                       of dimensions <expN1..expN4> (top,left,bott,right)
  1129.   
  1130.   Options             Title <expC2> i.e. "Select One"
  1131.                       <expL> determines (yes or no) whether a return is
  1132.                       to be executed on a first letter match. (default .f.)
  1133.   
  1134.   Examples            *
  1135.                       declare MEALS[3]
  1136.                       meals[1]= "Pizza"
  1137.                       meals[2]= "Chicken"
  1138.                       meals[3]= "Chinese"
  1139.   
  1140.                       * box only, no title
  1141.                       selection = MCHOICE(m->meals,10,10,5,25)
  1142.                            *or
  1143.                       * box with title
  1144.                       selection = MCHOICE("meals",10,10,5,25,"Pick-a-Meal")
  1145.                            *or
  1146.                       * box with title, first letter match = return
  1147.                       selection = MCHOICE(m->meals,10,10,5,25,"Pick-a-Meal",.f.)
  1148.   
  1149.   Notes               Bottom of window adjusts (shrinks) to adjust to
  1150.                       array size.
  1151.   
  1152.                       Yes, I know. I could have just passed the array
  1153.                       instead of the name of the array. Well, live and
  1154.                       learn. I've left it this way for compatibility with
  1155.                       the option to pass an actual array as well.
  1156.   Warning             Cursor is left ON
  1157.  
  1158.   Found in : S_MCHOI.PRG
  1159.   
  1160.   -------------------------------------------------
  1161.   Function            MENU_V()
  1162.   Action              Vertical popup menu from variable # parameters
  1163.   Returns             <expN> selection - 0 for no selection
  1164.   Category            Menu
  1165.   Syntax              MENU_V(<expC1>,<expC2>,<expC3>,...<expC16>)
  1166.   Description         Creates a popup vertical menu in a centered
  1167.                       box, using <expC1> as the title, and performing
  1168.                       a menu to on <expC1...expC16> (variable #)
  1169.                       <expC1> may be passed as "" for no title.
  1170.   Examples
  1171.                       choice = menu_v("Selection","Edit","Add","Quit")
  1172.                       *-or-
  1173.                       choice =menu_v("","Edit","Add","Quit")
  1174.   
  1175.   Warnings            A MENU TO is performed which tends to blow
  1176.                       active gets. Be careful if doing this during
  1177.                       a READ.
  1178.                       Cursor is left ON
  1179.   
  1180.  
  1181.   Found in : S_MENUV.PRG
  1182.   
  1183.   -------------------------------------------------
  1184.   Function            MESSYN()
  1185.   Action              Popup YesNo prompt box
  1186.   Returns             <expL> True for yes, False for No
  1187.   Category            Popup
  1188.   Syntax              MESSYN(<expC1>,[expN1],[expN2],[expC3],[expC4])
  1189.   Description         Pops up a box and displays a question <expC1>
  1190.                       and two prompts.
  1191.   
  1192.   Options             [expN1] and [expN2] are optional box top and left
  1193.                       coordinates. Default is centered. [expC3] and [expC4]
  1194.                       are optional prompts 1 and 2. Default is YES and NO.
  1195.   
  1196.                       The options can be given in any of the following
  1197.                       arrangements:
  1198.                         [expN1],[expN2],[expC3],[expC4]
  1199.                         [expC3],[expC4],[expN1],[expN2]
  1200.                         [expC3],[expC4]
  1201.                         [expN1],[expN2]
  1202.   
  1203.   Examples            if messyn("Are you done")
  1204.                 or    if messyn("Are you done",10,10)
  1205.                 or    if messyn("Are you done",10,10,"Not yet","Almost")
  1206.                 or    if messyn("Are you done","Not yet","Almost",10,10)
  1207.                 or    if messyn("Are you done","Not Yet","Almost"
  1208.   
  1209.   Warnings            Cursor is left ON
  1210.  
  1211.   Found in : S_MESSYN.PRG
  1212.   
  1213.   -------------------------------------------------
  1214.   Function            MFIELDS()
  1215.   Action              Pops up an achoice for current dbf fields
  1216.   Returns             <expC> field name or "" if none selected
  1217.   Category            Popup
  1218.   Syntax              <expC> = Mfields([expC],[expN1..expN4])
  1219.   Description         Popus up a box and presents an achoice() for the
  1220.                       current dbf fields.
  1221.   Options             [expC] title for box. [expN1..expN4]  coordinates
  1222.                       of the box. Default is centered.
  1223.   Examples            fieldname = MFIELDS()
  1224.                       *or
  1225.                       fieldname = MFIELDS("Pick a Field")
  1226.                       *or
  1227.                       fieldname = MFIELDS("Pick a Field",10,10,20,40)
  1228.   
  1229.   
  1230.   Warnings            Cursor is left ON
  1231.  
  1232.   Found in : S_MFLD.PRG
  1233.   
  1234.   -------------------------------------------------
  1235.   Function            MODIS()
  1236.   Action              Interactive modify or create structure
  1237.   Returns             Name of the dbf, less extension
  1238.   Category            Metafunction
  1239.   Syntax              MODIS([expC1],[expC2]|[array])
  1240.   Description         Interactive create or modify structure for DBF
  1241.                       files. If creating, allows import of an existing
  1242.                       structure.
  1243.   
  1244.   Options             [expC1] is "C" or "M" for Create or Modify. Default
  1245.                       is to prompt the user. [expC2]|[array] is either
  1246.                       the name of the dbf file or an array of allowable
  1247.                       dbf files.
  1248.   
  1249.   Examples            MODIS("C")
  1250.                       * create, prompt for name
  1251.                       *or
  1252.   
  1253.                       MODIS("M","CUSTOMER.DBF")
  1254.                       * modify customer.dbf
  1255.                       *or
  1256.   
  1257.                       declare okdbfs[3]
  1258.                       okdbfs[1]="CUSTOMER.DBF"
  1259.                       okdbfs[2]="INVOICE.DBF"
  1260.                       okdbfs[3]="TEMP.DBF"
  1261.   
  1262.                       MODIS("M",m->okdbfs)
  1263.                       * modify , selecting from array of dbfs
  1264.   
  1265.   Warnings            Make sure there is sufficient diskspace.
  1266.   
  1267.   Warnings            Key -9 is unset on exit (F10), DELETED is
  1268.                       left OFF
  1269.   
  1270.  
  1271.   Found in : S_MODIS.PRG
  1272.   
  1273.   -------------------------------------------------
  1274.   Function            MSG()
  1275.   Action              Displays up to a 9 line message in a window
  1276.   Returns
  1277.   Category            Popup
  1278.   Syntax              Up to 9 character strings as lines in the message .
  1279.   Description         Displays in a popup box up to 9 lines of a message.
  1280.                       Then waits for a keypress or optionally a time-out.
  1281.   Options             First parameter can be a number equalling a time-out
  1282.                       value in seconds
  1283.   Examples            MSG("An error has been detected","...don't move!")
  1284.                       MSG("A","B","C","D","E","F")
  1285.                       MSG(5,"A","B","C","D","E","F")
  1286.   Examples found in   S_CLAB.PRG S_DOALL.PRG S_DUP.PRG S_FILER.PRG S_FORML.PRG
  1287.                       S_FULLD.PRG S_GENVA.PRG S_GLOBR.PRG S_HELP.PRG S_LIST.PRG
  1288.                       S_LOOKF.PRG S_MODIS.PRG S_NEWDIR.PRG S_PREAD.PRG
  1289.                       S_PRINT.PRG S_QUERY.PRG S_SCROLL.PRG S_SUMAV.PRG
  1290.                       S_TAG.PRG S_ISPART.PRG
  1291.   Notes               Message is centered on screen in a box
  1292.                       Once message is displayed, waits for keypress and
  1293.                       then removes window, restoring screen underneath.
  1294.                       Or waits for time-out value.
  1295.   
  1296.   Warnings            Cursor is left ON
  1297.  
  1298.   Found in : S_MSG.PRG
  1299.   
  1300.   -------------------------------------------------
  1301.   Function            NKEY()
  1302.   Action              Gets key of an index file
  1303.   Returns             <expC> index key expression
  1304.   Category            File
  1305.   Syntax              NKEY(<expC>)
  1306.   Description         Gets key expression of index <expC>. <expC> is
  1307.                       the name of the index including extension. The
  1308.                       function operates differently from .ntx to .ndx.
  1309.   Examples            ndxknt = adir("*.ndx")
  1310.                       declare ind[ndxknt]
  1311.                       adir(ind,"*.ndx")
  1312.                       for i = 1 to ndxknt
  1313.                           ?"Key for index: "+ind[i]+" is "+NKEY(ind[i])
  1314.                       next
  1315.   
  1316.   Warnings            Uses up a file handle temporarily.
  1317.   
  1318.  
  1319.   Found in : S_NKEY.PRG
  1320.   
  1321.   -------------------------------------------------
  1322.   Function            OCCUR()
  1323.   Action              Build and display frequenty analysis for field
  1324.   Returns
  1325.   Category            Metafunction
  1326.   Syntax              Occur([array1],[array2])
  1327.   Description         Allows selection of a field and builds a
  1328.                       frequency count for values in that field.
  1329.                       A frequency count here being the number of
  1330.                       times each unique value for a given field
  1331.                       occurs in a database.
  1332.   Options             [array1] and [array2] are optional arrays of
  1333.                       field names and descriptions to use.
  1334.   
  1335.   Examples            OCCUR()
  1336.                        * or
  1337.                       USE CUSTOMER
  1338.                       private flds[3],fdes[3]
  1339.                       flds[1] = "fname"
  1340.                       flds[2] = "lname"
  1341.                       flds[3] = "mi"
  1342.                       fdes[1] = "First Name"
  1343.                       fdes[2] = "Last Name"
  1344.                       fdes[3] = "Middle Initial"
  1345.                       OCCUR(m->flds,m->fdes)
  1346.   
  1347.   Warnings            Cursor is left ON
  1348.   
  1349.  
  1350.   Found in : S_OCCUR.PRG
  1351.   
  1352.   -------------------------------------------------
  1353.   Function            ONE_READ()
  1354.   Action              Pop-up window with 1-4 Say/Get combinations
  1355.   Returns
  1356.   Category            Popup
  1357.   Syntax              ONE_READ(<expC1>,<expC2>,<expC3>,...)
  1358.   
  1359.   Description         For 1-4 iterations of <expC1..expC3>, a popup
  1360.                       window will display a Say <expC1>, do a Get on
  1361.                       the variable named in <expC2> with a Picture
  1362.                       of <expC3>. A read will then be issued.
  1363.   Examples            c_date = date()
  1364.                       c_time = space(8)
  1365.                       fun  = .t.
  1366.                       ONE_READ("Current Date","C_DATE","@D",;
  1367.                                "Current Time","C_TIME","99:99:99")
  1368.                                "Having Fun ?","FUN","Y")
  1369.   
  1370.   Notes               What I've since realised is that <expC2> should
  1371.                       actually be passed by reference (@). This would
  1372.                       cut down on all the macro-expansionitis.
  1373.   
  1374.                       ASSUMES GET VARIABLES HAVE BEEN INITIALIZED
  1375.                       IN CALLING PROGRAM
  1376.                       (I use this where I just need a quick read and don't
  1377.                        want to alter my current screen)
  1378.   
  1379.                       I've found it necessary to use odd variable names
  1380.                       as just a PRIVATE declare won't do. (this comes
  1381.                       about when a variable name such as WIDTH is
  1382.                       passed - if this proc has a variable named WIDTH,
  1383.                       (which it did), then the wrong WIDTH would be
  1384.                       READ. So, the variables have some very strange
  1385.                       names.
  1386.   
  1387.   
  1388.  
  1389.   Found in : S_ONER.PRG
  1390.   
  1391.   -------------------------------------------------
  1392.   Function            PLSWAIT()
  1393.   Action              Pops up a 'Please Wait' window or removes it
  1394.   Returns
  1395.   Category            Popup
  1396.   Syntax              PLSWAIT(<expL>,[expC],[expN1..expN4])
  1397.   Description         Pops up a window with a 'please wait' message
  1398.                       or removes a previous 'please wait' window.
  1399.                       <expL> True = popup window. <expL> False means
  1400.                       remove window.
  1401.   Options             [expC] - message. Default is 'Please wait...'
  1402.                       [expN1..expN4] box coordinates. Defaults are
  1403.                       10,20,12,60 (top,left,bottom,right)
  1404.   Examples
  1405.                       PLSWAIT(.T.,"I'm thinking...")
  1406.                       ...code...
  1407.                       ...code...
  1408.                       ...code...
  1409.                       PLSWAIT(.F.)
  1410.   
  1411.   Notes               Makes public the variables :
  1412.                       pls_top,pls_left,pls_bot,pls_right,pl_wait
  1413.                       And releases them when called with .f.
  1414.   
  1415.   
  1416.  
  1417.   Found in : S_PLSW.PRG
  1418.   
  1419.   -------------------------------------------------
  1420.   Function            POPEX()
  1421.   Action              Pops up an achoice for a certain filespec
  1422.   Returns             <expC> file name or "" for none
  1423.   Category            Popup
  1424.   Syntax              <expC> = Popex(<expC>,[expC])
  1425.   Description         Pops up a picklist for all files matching the
  1426.                       skeleton given as <expC>. i.e. "*.dbf"
  1427.   Options             Optional title string - displays at top of box
  1428.   Examples            opendbf = POPEX("*.DBF")
  1429.   
  1430.   Warnings            Cursor is left ON
  1431.  
  1432.   Found in : S_POPEX.PRG
  1433.   
  1434.   -------------------------------------------------
  1435.   Function            P_READY()
  1436.   Action              Determines if printer is ready, prompts user
  1437.   Returns             <expL> True if printer is ready
  1438.   Category            Popup
  1439.   Syntax              if p_ready()
  1440.   Description         Checks for printer ready, and prompts user to
  1441.                       ready the printer until it is ready, or until
  1442.                       user presses escape to abort printing.
  1443.   
  1444.                       Uses Clipper function ISPRINTER(), so is as
  1445.                       reliable as that.
  1446.   Examples            if P_READY()
  1447.                         REPORT FORM yayaya TO PRINT
  1448.                       ENDIF
  1449.   
  1450.  
  1451.   Found in : S_PREAD.PRG
  1452.   
  1453.   -------------------------------------------------
  1454.   Function            PRNTFRML()
  1455.   Action              Prints a formletter created by formletr()
  1456.   Returns
  1457.   Category            Popup
  1458.   Syntax              PRNTFRML(<expC>,<expN>)
  1459.   Description         Prints the form <expC> from FORMS.DBF with a
  1460.                       pagewidth of <expN>.
  1461.   Examples            This is used internally by FORMLETR() and
  1462.                       FASTFORM(). Refer to its usage there.
  1463.   
  1464.  
  1465.   Found in : S_PRNTF.PRG
  1466.   
  1467.   -------------------------------------------------
  1468.   Function            PULLDN()
  1469.   Action              Pulldown menu creator, handler
  1470.   Returns             A number in the form menu.prompt (i.e. 2.04)
  1471.   Category            Menu
  1472.   Syntax              <expN> = PULLDN(<expN>,<array1>,[array2],[array3])
  1473.   Description         Draws a pulldown menu with up to 8 seperate
  1474.                       boxes. Selection process starts with <expN>.
  1475.   
  1476.                       Each element of <array1> defines a menu.
  1477.                       A menu definition is a delimited string in the
  1478.                       form "TITLE:prompt:prompt:prompt" with up to 99
  1479.                       prompts per string.
  1480.   
  1481.   Options             [array2] is a box definition array. It is 7
  1482.                       elements long and defines the following:
  1483.   
  1484.                       Element:   1. <expL> Draw top bar box? T/F
  1485.                                  2. <expC> Top bar color
  1486.                                  3. <expC> Menu Box color
  1487.                                  4. <expC> Menu Box frame
  1488.                                  5. <expN> Menu Box shadow position
  1489.                                            (0,1,3,7,9)
  1490.                                  6. <expN> Menu Box shadow attribute
  1491.                                  7. <expN> Row to start menu bar
  1492.   
  1493.                       [array3] is an array of title column positions
  1494.                       to override the internal 'figerin algorithm.
  1495.   
  1496.   Examples
  1497.                       declare box[6],bdata[7]
  1498.                       box[1] = "Datafiles:Use Datafile"
  1499.                       box[2] = "Indices:Select Indices:Index order"
  1500.                       box[3] = "Editing:Field Replacement:Tabular Edit"
  1501.                       box[4] = "Reporting:Build Query:Print Lists"
  1502.                       box[5] = "Other:List text file:Change Directory"
  1503.                       box[6] = "Quit"
  1504.                       sf_sel = 1.01
  1505.   
  1506.                       *- define menu boxes
  1507.                       bdata[1]= .t.              && draw the top bar box
  1508.                       bdata[2]= 'W/B,GR/R,,,W/N' && top bar color string
  1509.                       bdata[3]= 'W/B,N/R,,,W/N'  && drop box color
  1510.                       bdata[4]= "┌─┐│┘─└│ "      && drop box frame
  1511.                       bdata[5]= 3                && drop box shadow position
  1512.                       bdata[6]= 8                && drop box shadow attribute
  1513.                       bdata[7]= 0                && row # of menu bar
  1514.   
  1515.                       do while .t.
  1516.                            sf_sel = PULLDN(sf_sel,box,bdata)
  1517.                            do case
  1518.                               case sf_sel = 1
  1519.                               case sf_sel = 2
  1520.                               case sf_sel = 3
  1521.                               case sf_sel = 4
  1522.                            endcase
  1523.                       enddo
  1524.   
  1525.   Notes               First letter selection takes place on the following
  1526.                       priority: next matching element first letter, next
  1527.                       matching box title first letter.
  1528.   
  1529.                       Passing a menu array element with title only will
  1530.                       result in no menu box, with the title being
  1531.                       the only selection and returning a selection
  1532.                       value of <MENU>.1.
  1533.                       (i.e. a 'Quit' box)
  1534.   
  1535.   Warnings            It takes some work to start all options and
  1536.                       titles with a first letter that is unique so that
  1537.                       first letter selection may take place.
  1538.   Warnings            Cursor is left ON
  1539.   
  1540.   
  1541.  
  1542.   Found in : S_PULLDN.PRG
  1543.   
  1544.   -------------------------------------------------
  1545.   Function            QUERY()
  1546.   Action              Interactive query by example condition builder
  1547.   Returns             <expC> macro expandable logical condition expression
  1548.   Category            Metafunction
  1549.   Syntax              expC = QUERY([ExpN],[array1],[array2])
  1550.   Description         A point and shoot condition builder. Complex
  1551.                       conditions are allowed with multiple .and./.or.
  1552.   
  1553.                       Called without parameters, all fields in the
  1554.                       current dbf are presented for condition building.
  1555.   
  1556.   Options             [ExpN],[array1],[array2] give field count, field
  1557.                       array and field description array. These, if passed
  1558.                       will be used in place of the default of all dbf
  1559.                       fields.
  1560.   
  1561.   Examples
  1562.                       USE CUSTOMER
  1563.                       private flds[3],fdes[3]
  1564.                       flds[1] = "fname"
  1565.                       flds[2] = "lname"
  1566.                       flds[3] = "mi"
  1567.                       fdes[1] = "First Name"
  1568.                       fdes[2] = "Last Name"
  1569.                       fdes[3] = "Middle Initial"
  1570.                       qcond = "lastname > 'CCCC' "
  1571.                       filt = query(3,flds,fdes)
  1572.                       set filter to &filt
  1573.                       ...
  1574.                       or
  1575.                       ...
  1576.                       USE CUSTOMER
  1577.                       looker = query()
  1578.                       locate for &looker
  1579.   
  1580.   Notes               Makes variable 'QUERY_EXP' public. This contains the
  1581.                       current query expression, which is retained between
  1582.                       calls of query, and is looked for by other
  1583.                       SUPER functions.
  1584.   
  1585.   Warnings            Macro expanding the QUERY_EXP variable lengthens
  1586.                       the command line on which it is expanded. If the
  1587.                       command line goes beyond 254 characters, the
  1588.                       program will bomb. If this becomes a problem, create
  1589.                       a function called EVAL() or some such that you pass
  1590.                       QUERY_EXP to and it just does a return(&query_exp).
  1591.                       Then use it like so:
  1592.   
  1593.                       LOCATE FOR EVAL(m->query-exp)
  1594.   
  1595.   Warnings            Key -1 is unset on exit (F2)
  1596.                       Key -2 is unset on exit (F3)
  1597.   
  1598.  
  1599.   Found in : S_QUERY.PRG
  1600.   
  1601.   -------------------------------------------------
  1602.   Function            SCMOD()
  1603.   Action              Maintains scroller.dbf - see scroller()
  1604.   Returns
  1605.   Category            Development
  1606.   Syntax              SET KEY xxx to SCMOD
  1607.   Description         SCMOD() is a tool for online building and
  1608.                       modifying of the SCROLLER.DBF used for
  1609.                       SCROLLER() lookup tables.
  1610.   
  1611.                       When called by a SET KEY, it recieves the
  1612.                       PROCEDURE and VARIABLE parameters from the
  1613.                       calling PROCEDURE. It then determines if there
  1614.                       exists a matching record in the SCROLLER.DBF.
  1615.                       If so, the lookup definition may be modified.
  1616.                       Otherwise, a new lookup definition may be created.
  1617.   
  1618.   Options
  1619.   Examples            EXTERNAL SCMOD
  1620.                       SET KEY -31 TO SCMOD  && ALT-F2
  1621.   
  1622.   Examples found in   No examples in the library. This is a development
  1623.                       tool.
  1624.   
  1625.   Notes               Be sure to declare SCMOD external.
  1626.   
  1627.   Warnings            SCMOD() will blow your get stack. It is primarily
  1628.                       for development, so this should not be a problem.
  1629.                       If you have a library that saves and restores gets,
  1630.                       this would be an indicated place to use them.
  1631.   
  1632.   Dbfs/indexes used
  1633.                       SCROLLER.DBF has the structure :
  1634.   
  1635.                        Structure for database : SCROLLER.DBF
  1636.                        Field  Field Name  Type       Width    Dec
  1637.                        calling procedure......... 1  SMODULE     C  8
  1638.                        calling variable.......... 2  SFIELD      C  10
  1639.                        description............... 3  SDESCR      C  25
  1640.                        display string............ 4  SSTRING     C  160
  1641.                        return string............. 5  SRETURN     C  75
  1642.                        dbf file to lookup into... 6  SDBFILE     C  8
  1643.                        index to use with dbf..... 7  SIND        C  8
  1644.   
  1645.                       SCMOD() will create SCROLLER.DBF if it doesn't exist.
  1646.   
  1647.   Warnings            Key -1 is unset on exit (F2)
  1648.   Warnings            Cursor is left ON
  1649.  
  1650.   Found in : S_SCMOD.PRG
  1651.   
  1652.   -------------------------------------------------
  1653.   Function            SCROLLER()
  1654.   Action              Hotkey lookup tables with dbf storage
  1655.   Returns
  1656.   Category            Lookup
  1657.   Syntax              SET KEY xxx TO SCROLLER
  1658.                       Scroller([expC1],[expN],[expC2],[expC3], ;
  1659.                                [expC4],[expC5],[expC6],[expC7])
  1660.   
  1661.   Description         Scroller is primarily a hotkey lookup table
  1662.                       engine, although it can be called directly
  1663.                       as well. Scroller is data-driven (although
  1664.                       that sure is becoming a buzzword) , meaning
  1665.                       it can operate on data stored external to
  1666.                       the EXE in SCROLLER.DBF.
  1667.   
  1668.                       SCROLLER() is normally called via a SET KEY.
  1669.                       When called, it recieves the parameters
  1670.                       PROCNAME and VARIABLE from Clipper, telling
  1671.                       it the proc and variable the user was sitting
  1672.                       on when he pressed the hotkey. The actual
  1673.                       parameters rec'd are PROCNAME,LINE,VARIABLE.
  1674.                       Line is ignored, but it is included as the
  1675.                       2nd parameter because it is passed.
  1676.   
  1677.                       SCROLLER() attemps to find a corresponding
  1678.                       record in SCROLLER.DBF (which contains fields
  1679.                       for PROCNAME and VARIABLE). SCROLLER.DBF is
  1680.                       a storage place for lookup definitions. It
  1681.                       contains:
  1682.                         
  1683.                        SMODULE C   8   Procname from SET KEY
  1684.                        SFIELD  C  10   Variable name from SET KEY
  1685.                        SDESCR  C  25   Description field used as title
  1686.                        SSTRING C 160   Say string - what is displayed
  1687.                                        in the lookup box
  1688.                        SRETURN C  75   Return string - what is sent to
  1689.                                        the keyboard via KEYBOARD
  1690.                        SDBFILE C   8   Lookup DBF file name
  1691.                        SIND    C   8   Lookup Index file name
  1692.   
  1693.                       If SCROLLER does not find a matching record, it
  1694.                       simply closes SCROLLER.DBF and returns to the
  1695.                       previous area. It then displays a 'lookup table
  1696.                       not found' message.
  1697.   
  1698.                       If SCROLLER finds a matching record, it loads the
  1699.                       values into memory and closes SCROLLER.DBF. It then
  1700.                       opens the DBF [and index] of the lookup dbf in
  1701.                       the next available area. If it is unable to open
  1702.                       the dbf, it displays an error message and goes back
  1703.                       to the previously selected area.
  1704.   
  1705.                       SCROLLER then draws a box, using the DESCRIPTION
  1706.                       field as the title, ititializes a 1 element array
  1707.                       composed of the SSTRING expression and calls
  1708.                       DBEDIT() with a udf. While in the DBEDIT(), first
  1709.                       letter searches can be done if the dbf is indexed
  1710.                       with a character index. Pressing ENTER will KEYBOARD
  1711.                       the expression in SRETURN (unless its empty), close
  1712.                       up the current area and return to the old area.
  1713.                       Pressing escape just closes things up and returns to
  1714.                       the old area.
  1715.   
  1716.                       The KEYBOARD then takes over, feeding the SRETURN
  1717.                       expression into the keyboard and into the current
  1718.                       GET or GETS.
  1719.   
  1720.                       Scroller may ALSO be called directly with the
  1721.                       parameters being:
  1722.   
  1723.                       1. ""     ──┐  to account for the
  1724.                       2. 0        ├─ set key parameters
  1725.                       3. ""     ──┘
  1726.                       4. [expC1]   lookup box display line
  1727.                       5. [expC2]   lookup box value to keyboard
  1728.                       6. [expC3]   dbf file to do lookup into
  1729.                       7. [expC4]   index file to use with lookup dbf
  1730.                       8. [expC5]   description - used as box header
  1731.   
  1732.                       If no parameters are passed, the user is prompted
  1733.                       for the lookup values.
  1734.   
  1735.                       If [expC1] is passed, the current DBF is used
  1736.                       for the lookup. If [expC2] is also passed, a
  1737.                       value is sent to the keyboard. If [expC3] and
  1738.                       optionally [expC4] are passed, a DBF and optionally
  1739.                       and index are opened for the lookup. [expC5] if
  1740.                       passed is used as a title.
  1741.   
  1742.   
  1743.   Options
  1744.   Examples            EXTERNAL SCROLLER
  1745.                       SET KEY -1 TO SCROLLER   && F2
  1746.                       ..or
  1747.   
  1748.                       SCROLLER()     && for user prompting
  1749.                       ..or
  1750.   
  1751.                       SCROLLER("",0,"","LASTNAME+' '+FIRSTNAME","","CUST")
  1752.                       ** would open up CUST.DBF and present a lookup
  1753.                       ** table of the expression "LASTNAME+' '+FIRSTNAME"
  1754.   
  1755.   Examples found in   Well personally I've taken to using SMALLS(), a
  1756.                       smaller, streamlined lookup engine.
  1757.   
  1758.   Notes               See SMALLS() - an alternate to SCROLLER().
  1759.                       SCROLLER is the most difficult function in the
  1760.                       library. As such, it may find itself replaced
  1761.                       by a set of smaller, simpler replacement functions.
  1762.   
  1763.   Warnings            Be sure to declare SCROLLER EXTERNAL!
  1764.   
  1765.  
  1766.   Found in : S_SCROLL.PRG
  1767.   
  1768.   -------------------------------------------------
  1769.   Function            SETCOLORS()
  1770.   Action              Interactive color setting interface
  1771.   Returns
  1772.   Category            Development
  1773.   Syntax              SETCOLORS()
  1774.   Description         This is a development tool for finding nice
  1775.                       combinations of colors for the global super.lib
  1776.                       colors. I would not give this to an end user, as
  1777.                       is just TOO MANY CHOICES!
  1778.   
  1779.                       I normally select 10-15 nice combinations of the
  1780.                       colors and give the user a selection of those,
  1781.                       giving them such names as 'Hawaiian Blue' or
  1782.                       'Royal Red'.
  1783.   
  1784.                       First, a word on the Super.Lib color scheme:
  1785.   
  1786.                       This is not the perfect color scheme. It is the one
  1787.                       on which this library runs. (hey - I hadda pick
  1788.                       something) I also realize full well that color
  1789.                       selection is more art than it is technical, and
  1790.                       it is difficult to get two people to agree on a
  1791.                       color scheme.
  1792.   
  1793.                       Several global (public) color variables are used by
  1794.                       the functions. These are:
  1795.   
  1796.                       c_normcol   -  For normal input/output
  1797.                       c_normmenu  -  For normal 'menu to' operations
  1798.                       c_popcol    -  For popup box colors
  1799.                       c_popmenu   -  For popup box menus
  1800.                       c_frame     -  Frame string ("┌─┐│┘─└│ ")
  1801.                       c_shadatt   -  Shadow color attribute (numeric)
  1802.                       c_shadpos   -  Shadow position (0,1,3,7,9)
  1803.                       c_xplode    -  Logical - explode windows?
  1804.   
  1805.                       All are of the format "f/b,f/b,,,f/b"
  1806.                       (f-foreground b-background)
  1807.   
  1808.                       The functions INITCOL() or INITSUP() will initialise
  1809.                       these colors, and INITSUP() called if a function
  1810.                       detects the colors have not already been set.
  1811.   
  1812.                       SETCOLORS() allows interactive setting of these colors.
  1813.                       The variables are stored in COLORS.MEM - which is
  1814.                       created if needed by SETCOLORS().
  1815.   
  1816.                       If COLORS.MEM is not present, INITSUP() will
  1817.                       initialise a default set of colors, otherwise it
  1818.                       will restore from colors.mem
  1819.   
  1820.   Options
  1821.   Examples            SETCOLORS()
  1822.   
  1823.                       * then initialize the colors
  1824.                       restore from colors.mem addit
  1825.   
  1826.                       * then set the colors
  1827.                       SET COLOR TO (C_normcol)
  1828.   
  1829.   Notes               SETCOLORS() does not effect the current color
  1830.                       setting. It manipulates COLORS.MEM. To utilize
  1831.                       colors selected by SETCOLORS(), a restore from
  1832.                       COLORS.MEM must be done.
  1833.   
  1834.   Warnings            I've had problems with old copies of COLORS.MEM
  1835.                       (from previous versions) and also with COLORS.MEM
  1836.                       created by other programs. If you run into
  1837.                       troubles, try erasing COLORS.MEM.
  1838.   
  1839.                       Lots of direct screen writing here. You'll need
  1840.                       an IBM compatible.
  1841.   
  1842.   
  1843.  
  1844.   Found in : S_SETCOL.PRG
  1845.   
  1846.   -------------------------------------------------
  1847.   Function            SMALLS()
  1848.   Action              Lookup tables on dbf - no call to dbedit <small>
  1849.   Returns
  1850.   Category            Lookup
  1851.   Syntax              Smalls(expC,[expC],[expC/N],[expC],[expC/N],[expC/N)
  1852.   Description         This is a next generation lookup engine, and is
  1853.                       the Son of Scroller(). (smalls = small scroller)
  1854.   
  1855.                       It is called directly as follows:
  1856.                       1. ExpC       - the display string for the
  1857.                                       lookup box.
  1858.   
  1859.   Options             2. ExpC       - a title for the lookup box
  1860.                       3. ExpC/ExpN  - A. alias name             or
  1861.                                       B. numeric work area      or
  1862.                                       C. dbf/ndx in the format:
  1863.                                          "%dbfname%ndxname"
  1864.                       4. ExpC       - expression to keyboard if ENTER
  1865.                                       pressed
  1866.                       5. ExpC/N     - numeric   - starting record
  1867.                                       character - starting key
  1868.                                       (only if indexed)
  1869.   
  1870.                       6. ExpC/N     - numeric   - ending record
  1871.                                       character - ending key
  1872.                                       (only if indexed)
  1873.   Examples
  1874.                       (assumes dbf fields of LNAME and FNAME)
  1875.   
  1876.                       * lookup on "LNAME+' '+FNAME" in current area
  1877.                       smalls("LNAME+' '+FNAME")
  1878.                       ...or
  1879.   
  1880.                       * lookup on "LNAME+' '+FNAME" in current area
  1881.                       * use "Name" as box title
  1882.                       smalls("LNAME+' '+FNAME","Name")
  1883.                       ...or
  1884.   
  1885.                       * lookup on "LNAME+' '+FNAME" in current area
  1886.                       * use "Name" as box title
  1887.                       * go to area 5 for the lookup
  1888.                       * send LNAME to the keyboard if CR pressed
  1889.                       smalls("LNAME+' '+FNAME","Name",5,"LNAME")
  1890.                       ...or
  1891.   
  1892.                       * lookup on "LNAME+' '+FNAME" in current area
  1893.                       * use "Name" as box title
  1894.                       * go to alias CUSTOMER for the lookup
  1895.                       smalls("LNAME+' '+FNAME","Name","CUSTOMER")
  1896.                       ...or
  1897.   
  1898.                       * open customer.dbf and do a lookup on it
  1899.                       * lookup on "LNAME+' '+FNAME"
  1900.                       * use "Name" as box title
  1901.                       smalls("LNAME+' '+FNAME","Name","%CUSTOMER")
  1902.   
  1903.                       * open customer.dbf and do a lookup on it
  1904.                       * lookup on "LNAME+' '+FNAME"
  1905.                       * use "Name" as box title
  1906.                       * limit lookup to between records 50 and 60
  1907.                       smalls("LNAME+' '+FNAME","Name","%CUSTOMER",50,60)
  1908.   
  1909.                       * open CUSTOMER.DBF with LNAME.NDX and do a lookup
  1910.                       * lookup on "LNAME+' '+FNAME"
  1911.                       * use "Name" as box title
  1912.                       smalls("LNAME+' '+FNAME","Name","%CUSTOMER%LNAME")
  1913.   
  1914.                       * open CUSTOMER.DBF with LNAME.NDX and do a lookup
  1915.                       * lookup on "LNAME+' '+FNAME"
  1916.                       * use "Name" as box title
  1917.                       * limit lookup to JAAAA-ZZZZZ
  1918.                       smalls("LNAME+' '+FNAME","Name","%CUSTOMER%LNAME", ;
  1919.                          "JAAAAA","ZZZZZ")
  1920.   
  1921.   Notes               Very shortly (if not already done) I will be
  1922.                       modifying SCROLLER() to call SMALLS() instead
  1923.                       of DBEDIT(), thus reducing the weight of
  1924.                       SCROLLER() considerably.
  1925.   
  1926.                       The display string must evaluate to a character
  1927.                       expression when macro-expanded. For instance, a
  1928.                       date field called CDATE would crash if passed as
  1929.                       smalls("CDATE"), as it would evaluate to date type,
  1930.                       but if passed as smalls("dtoc(CDATE)" all would be
  1931.                       well.
  1932.                       The KEYBOARD expression must also evaluate to
  1933.                       type CHARACTER
  1934.   
  1935.   
  1936.  
  1937.   Found in : S_SMAL.PRG
  1938.   
  1939.   -------------------------------------------------
  1940.   Function            STANDARD()
  1941.   Action              Returns color integer for standard setting
  1942.   Returns             nothing
  1943.   Category            Screen
  1944.   Syntax              <expN> = STANDARD()
  1945.   Description         Returns numeric color integer for use with
  1946.                       functions which require it like ATT(), PRNT().
  1947.   Examples            stan = standard()+128   && blinking
  1948.                       PRNT(10,10,"Waiting...",m->stan)
  1949.  
  1950.   Found in : S_STAN.PRG
  1951.   
  1952.   -------------------------------------------------
  1953.   Function            SUM_AVE()
  1954.   Action              Interactive sum or average on a dbf field
  1955.   Returns
  1956.   Category            Metafunction
  1957.   Syntax              SUM_AVE([expC])
  1958.   Description         Does a SUM or AVERAGE on a selected numeric
  1959.                       field
  1960.   
  1961.   Options             [expC] "SUM" or "AVE". Default is "SUM"
  1962.   
  1963.   Examples            case choice = 3  && sum
  1964.                         SUM_AVE("SUM")
  1965.                       case choice = 4  && average
  1966.                         SUM_AVE("AVE")
  1967.   
  1968.   Notes
  1969.                       If QUERY_EXP is present  - public variable
  1970.                       created by QUERY() - optional SUM or AVERAGE
  1971.                       for QUERY_EXP can be done.
  1972.   
  1973.  
  1974.   Found in : S_SUMAV.PRG
  1975.   
  1976.   -------------------------------------------------
  1977.   Function            TAGIT()
  1978.   Action              Allows tagging of dbf records for later action
  1979.   Returns
  1980.   Category            Metafunction
  1981.   Syntax              TAGIT(<array1>,[array2],[array3])
  1982.   Description         Performs a no-touch tag on records in the dbf.
  1983.                       It does this by filling <array1> - an array
  1984.                       which you need to initialize to the max # of
  1985.                       records you want to tag - with tagged record
  1986.                       numbers.
  1987.   
  1988.                       DBEDIT() is called with a UDF to show on
  1989.                       screen what records have been tagged.
  1990.   
  1991.                       Ascan may then be used with the array to
  1992.                       evaluate to a logical condition for searches,
  1993.                       copies, printing etc. with the general
  1994.                       syntax of: (ascan(<array1>,recno()) > 0)
  1995.   
  1996.   
  1997.   Options             [array2] and [array3] may be passed as fields
  1998.                       and field descriptions. These are then passed
  1999.                       to DBEDIT() as the fields and titles arrays.
  2000.   
  2001.   Examples            private tag[100]
  2002.                       tagit(tag)
  2003.                       copy to temp for (ascan(tag,recno()) > 0)
  2004.   
  2005.  
  2006.   Found in : S_TAG.PRG
  2007.   
  2008.   -------------------------------------------------
  2009.   Function            UNBOX()
  2010.   Action              Removes a box created by makebox()
  2011.   Returns
  2012.   Category            Popup
  2013.   Syntax              Unbox(<expC>,[expN1..expN4])
  2014.   Description         UNBOX restores the screen <expC> saved by
  2015.                       MAKEBOX(). MAKEBOX() stores the dimensions
  2016.                       and color in the returned string, so it is not
  2017.                       necessary to pass these to UNBOX(). If the dimensions
  2018.                       are passed, UNBOX() assumes these are not part of
  2019.                       the saved string, and assumes the string is a
  2020.                       savescreen() string. If the string and any other
  2021.                       single param are passed, UNBOX() assumes it is
  2022.                       a full screen (0,0,24,79) restore and does so.
  2023.   
  2024.   Options             [expN1..expN4] - the dimensions of the box.
  2025.                       Use these to UNBOX() a screen saved with SAVESCREEN().
  2026.   
  2027.   Examples            msg = MAKEBOX(10,40,12,60,'W/R,+GR/R')
  2028.                       @11,42 SAY "What's up, Doc ?"
  2029.                       inkey(0)
  2030.                       UNBOX(m->msg)
  2031.   
  2032.                       ..or unboxing a SAVESCREEN() screen
  2033.                       msg = savescreen(5,5,10,10)
  2034.                       *code
  2035.                       *code
  2036.                       *code
  2037.                       unbox(msg,5,5,10,10)
  2038.   
  2039.                       ..or unboxing a full screen
  2040.                       save screen to msg
  2041.                       *code
  2042.                       *code
  2043.                       *code
  2044.                       unbox(msg,<anyparam>)
  2045.   
  2046.   Notes               This replaces KILLWIND(), as MAKEBOX() replaces
  2047.                       MAKEWIND().
  2048.   
  2049.  
  2050.   Found in : S_UNBOX.PRG
  2051.   
  2052.   -------------------------------------------------
  2053.   Function            UNSELECTED()
  2054.   Action              Returns color integer for UNSELECTED setting
  2055.   Returns             <expN> numeric color integer
  2056.   Category            Screen
  2057.   Syntax              <expN> = unsel
  2058.   Description         Returns numeric color integer for use with
  2059.                       functions which require it like ATT(), PRNT().
  2060.   Examples            enhan= enhanced()+128   && blinking
  2061.                       PRNT(10,10,"Waiting...",m->enhan)
  2062.  
  2063.   Found in : S_UNSEL.PRG
  2064.   
  2065.   -------------------------------------------------
  2066.   Function            VAR2CHAR()
  2067.   Action              Converts any type variable to character type
  2068.   Returns             <expC> character
  2069.   Category            String
  2070.   Syntax              Var2char(<expC>)
  2071.   Description         Converts variable named in <expC> to type
  2072.                       character
  2073.   Options
  2074.   Examples            dtype = ctod("01/01/80")
  2075.                       ntype = 128.45
  2076.                       ltype = .t.
  2077.                       VAR2CHAR("dtype") returns "01/01/80"
  2078.                       VAR2CHAR("ntype") returns "128.45"
  2079.                       VAR2CHAR("ltype") returns ".t."
  2080.   
  2081.   Notes               Returns memo types as ""
  2082.   
  2083.  
  2084.   Found in : S_VAR2.PRG
  2085.   
  2086.   -------------------------------------------------
  2087.   Function            VARLENGTH()
  2088.   Action              Returns length of a variable  of any type
  2089.   Returns             Length of variable
  2090.   Category            String
  2091.   Syntax              Varlength(exp?]
  2092.   Description         Converts exp? to character with VAR2CHAR() and
  2093.                       then returns its length
  2094.   Options
  2095.   Examples            VARLENGTH(123.45) returns 6
  2096.                       VARLENGTH(.F.)    returns 3
  2097.                       VARLENGTH(DATE()) returns 8
  2098.   
  2099.  
  2100.   Found in : S_VARLEN.PRG
  2101.   
  2102.   -------------------------------------------------
  2103.   Function            WRITEFILE()
  2104.   Action              Writes a line or lines  to a text file
  2105.   Returns
  2106.   Category            File
  2107.   Syntax              Writefile(<expC1|expN>,<expC2>)
  2108.   Description         Writes line(s) of text with CR LF to
  2109.                       a file referenced either as a file handle
  2110.                       <expN> or a filename <expC1>. Writes either
  2111.                       a single line contained in <expC2> or all
  2112.                       of the contents of a character array named
  2113.                       as <expC2> to the file.
  2114.   
  2115.   Examples
  2116.                       1. WRITEFILE('ERROR.TXT','THERE WAS AN ERROR')
  2117.   
  2118.                       2. declare errors[3]
  2119.                          errors[1] = 'There was an error'
  2120.                          errors[2] = 'Error # 61765     '
  2121.                          errors[3] = dtoc(date)
  2122.                          writefile('ERROR.TXT','ERRORS')
  2123.   
  2124.                       3. handle = fopen("error.txt",1)
  2125.                          declare errors[3]
  2126.                          errors[1] = 'There was an error'
  2127.                          errors[2] = 'Error # 61765     '
  2128.                          errors[3] = dtoc(date())
  2129.                          writefile(handle,'ERRORS')
  2130.   
  2131.   Notes               IF A FILENAME IS PASSED, THE FILE IS OPENED AND
  2132.                       CLOSED BY THE FUNCTION.
  2133.   
  2134.                       IF A FILE HANDLE IS PASSED, THE FILE IS LEFT OPEN.
  2135.   
  2136.                       IF A CHARACTER ARRAY IS PASSED, EACH ELEMENT IS
  2137.                       WRITTEN TO A SEPERATE LINE IN THE FILE.
  2138.   
  2139.                       DO NOT PASS AN ARRAY - PASS AN ARRAY NAME IN QUOTES
  2140.   
  2141.                       IF THE FILE DOES NOT EXIST, IT IS CREATED.
  2142.  
  2143.   Found in : S_WRITEF.PRG
  2144.   
  2145.